﻿{extend name="$index_style_layout" /}

<!--SEO相关-->
{block name="head_title"}{$fid?($info['seo_title']?:$info['name']):$m_info['title']}{/block}
{block name="head_keword"}{$fid?($info['seo_keywords']?:$info['name']):$m_info['title']}{/block}
{block name="head_description"}{$info.seo_description}{/block}

 
{block name="body_content"}
<link href="__STATIC__/group/pclist/circle_list.css" rel="stylesheet" type="text/css" />
<link href="__STATIC__/group/pclist/hover.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.listbox .price{
	margin-top:30px;
	font-size:16px;
}
.listbox .price a{
	background:orange;
	color:#fff;
	margin-left:30px;
	padding:5px;
}
</style>
<div class="contbox">
	<div class="content">		
		<div class="maincont2">
			<div class="left">
				<div class="main">
					<div class="shead">
						<div class="tag">
							<div class="first" onclick="chagetype(0)"><a href="#" class="button pulse-shrink">最多粉丝</a></div>
							<div onclick="chagetype(1)"><a href="#" class="button pulse-shrink">最多贴子</a></div>	
							<div onclick="chagetype(2)"><a href="#" class="button pulse-shrink">最高人气</a></div>
						</div>
					</div>

					<div class="listbox">
						<div class="cont">
							{qb:tag name="qun_pc_ad_index" type="qun" by="desc" where="openad<>0" union="order" order="usernum" rows="8"}
							<div class="list">
								<div class="showpic"><a href="{$rs.url}" class="button buzz-out"><img src="{$rs.picurl}" onerror="this.src='__STATIC__/images/nopic.png'"></a></div>
								<div class="mytext">
									<div class="tag">
										<a href="{$rs.url}">{$rs.title}</a>
										<span><i class="fa fa-fw fa-user-o"></i>{$rs.usernum}</span>
										<span><i class="fa fa-fw fa-file-text-o"></i>{:fun('qun@count','bbs_content1',$rs.id)}</span>
										<span><i class="si si-fire"></i>{$rs.view}</span>
									</div>
									<div class="word">
										{$rs.content|get_word=200}
									</div>	
									<div class="price">
										{php}$adset=fun("qun@adset_status",$rs['id']);{/php}
										{$adset.price}元/{$adset.day}天 生效时间：{$adset.time|format_time="Y-m-d H:i"}
										<a href="{:murl('qun/aduser/add',['aid'=>$rs['id']])}">投放广告</a>
									</div>
								</div>
							</div>
							{/qb:tag}
						</div>						
						<div class="cont"></div>
						<div class="cont"></div>
					</div>
				</div>
<script type="text/javascript">

var choose_i = 0; //选中第几项
var haveshowpage = []; //每一项,作个标志,已经已显示到第几页
var orders = ['usernum','replynum','view'];
//显示更多
function showMoreContent(){	
	var url = '{qb:url name="qun_pc_ad_index" /}' + haveshowpage[choose_i] + '&order=' + orders[choose_i] ;	//第几项对应的网址	
	$.get(url,function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
			}else{
				if(haveshowpage[choose_i]==1){
					$('.listbox .cont').eq(choose_i).html(res.data);
				}else{
					$('.listbox .cont').eq(choose_i).append(res.data);
				}
				haveshowpage[choose_i]++;
				scroll_get = true;
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}

function chagetype(num){
	choose_i = num;

	$('.shead .tag div').removeClass('first');
	$('.shead .tag div').eq(num).addClass('first')
	$('.listbox .cont').hide();
	$('.listbox .cont').eq(num).show();

	if(typeof haveshowpage[choose_i] == 'undefined'){
		haveshowpage[choose_i] = 1;
		showMoreContent();
	}
}
chagetype({:intval(input('type'))});


//滚动显示更多
var scroll_get = true;	//做个标志,不要反反复复的加载
$(document).ready(function () {
	$(window).scroll(function () {
		if (scroll_get==true &&  (400 + $(window).scrollTop())>($(document).height() - $(window).height())) {
			scroll_get = false;			
			layer.msg('内容加截中,请稍候',{time:1500});
			showMoreContent();
		}
	});
});
</script>
			</div><!--left end-->
			
			<div class="right">
				<div class="main">
					<div class="mycode">
						<a href="{:murl('adset/edit')}" class="button pulse-shrink _pop"><i class="fa fa-gear"></i>设置我的广告位</a>
						<!--<span><img src="__STATIC__/group/pclist/code.jpg"></span>
						<p>扫一扫 访问手机版</p>-->
					</div>				
				</div>
				<div class="main">
					<div class="myhead"><span>__QUN__分类</span></div>
					<div class="myproduct">
						<ul>
{volist name="''|sort_config" id="rs"}
							<li><a href="{:urls('content/index',['fid'=>$rs['id']])}" {eq name="rs.id" value="$fid"} style="background:orange;color:#fff;" {/eq} class="button buzz-out">{$rs.name}</a></li>
{/volist}
						 
						</ul>
					</div>		
				</div>
				
				<div class="main">
					<div class="myhead"><span>活跃圈友</span></div>
					<div class="myfriends">
						<ul class="qun_pc_list002">
							{qb:tag name="qun_pc_list002" class="app\qun\model\Member@get_label" rows="4" js="qun_pc_list002"}
							<li>
								<a href="#">
									<span><img src="{$rs.icon}" onerror="this.src='__STATIC__/images/nobody.gif'"></span>
									<p>{$rs.username}</p>
								</a>
							</li>
							{/qb:tag}							
						</ul>
						<div class="more ShowMores"><a href="javascript:" onclick="showMoreShop('{qb:url name="qun_pc_list002"/}')" class="button pulse-shrink">查看更多</a></div>
					</div>		
				</div>
			</div><!--right end-->
		</div><!--maincont2 end-->
		
	</div><!--content end-->
</div>
<script type="text/javascript">
var shoppage=1;
function showMoreShop(url){	
	shoppage++;
	$.get(url+shoppage+'&'+Math.random(),function(res){
		if(res.code==0){
			if(res.data==''){
				layer.msg("已经显示完了！",{time:500});
				$('.ShowMores a').attr('onclick','');
				$('.ShowMores a').html('显示完了');
				$('.ShowMores a').css({'background':'#eee'});
			}else{
				$('.qun_pc_list002').append(res.data);
			}
		}else{
			layer.msg(res.msg,{time:2500});
		}
	});
}
</script>
{/block}